support ddtrace v6 for node > 22 - #818
Conversation
This comment has been minimized.
This comment has been minimized.
|
Thanks for working on the per-runtime tracer split. The layer mapping (v5 for Node 18/20 and v6 for Node 22+) makes sense. I think the npm contract needs to be explicit before we rely on this for the migration. Here are concrete changes I suggest: 1. Declare the npm compatibility contract
{
"engines": {
"node": ">=18"
},
"peerDependencies": {
"dd-trace": "^5.123.0 || ^6.12.0"
},
"peerDependenciesMeta": {
"dd-trace": {
"optional": true
}
}
}The root devDependency can remain 2.
|
…ting v20+ local development
Three conflicts, all resolved as unions of both sides: - src/handler.mjs: main (#819) moved the ESM loader-hook registration out of handler.mjs into initTracer() in src/runtime/module_importer.js, so this branch's copy of esmLoaderAlreadyRegistered() and the Module.register() block are dropped in favor of main's. Kept this branch's new DD_TRACE_STARTUP_LOGS default. dd-trace 6.12.0 ships both register.js and loader-hook.mjs, so main's registration path works on the v6 line. - integration_tests/container/cjs/Dockerfile: kept this branch's DD_TRACE_VERSION build-arg + `npm pkg set` override alongside main's `COPY package.json *.js` for the new manual-wrap fixture handlers. - integration_tests/container/cjs/package.json: main's axios pin plus this branch's dd-trace 6.12.0. main's integration_tests_local/run.sh already probes for scripts/install_deps.sh and scripts/dd_trace_versions.sh and passes --build-arg DD_TRACE_VERSION, so the new local harness picks up the per-runtime tracer split without changes. Verified: yarn build, yarn test (638 tests, 52 suites — including main's new src/handler.spec.ts and src/runtime/module-importer.spec.ts), yarn lint and yarn check-formatting all pass against dd-trace 6.12.0. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
What does this PR do?
Motivation
Testing Guidelines
Additional Notes
Types of Changes
Check all that apply